/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gmao.entities;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Amine
 */
@Entity
@Table(name = "type_intervention")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TypeIntervention.findAll", query = "SELECT t FROM TypeIntervention t"),
    @NamedQuery(name = "TypeIntervention.findByType", query = "SELECT t FROM TypeIntervention t WHERE t.type = :type"),
    @NamedQuery(name = "TypeIntervention.findByBoolean1", query = "SELECT t FROM TypeIntervention t WHERE t.boolean1 = :boolean1"),
    @NamedQuery(name = "TypeIntervention.findByIdentType", query = "SELECT t FROM TypeIntervention t WHERE t.identType = :identType")})
public class TypeIntervention implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @Column(name = "type")
    private String type;
    @Column(name = "BOOLEAN")
    private Boolean boolean1;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @NotNull
    @Column(name = "ident_type")
    private Integer identType;
    @OneToMany(mappedBy = "identType")
    private List<Intervention> interventionList;

    public TypeIntervention() {
    }

    public TypeIntervention(Integer identType) {
        this.identType = identType;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Boolean getBoolean1() {
        return boolean1;
    }

    public void setBoolean1(Boolean boolean1) {
        this.boolean1 = boolean1;
    }

    public Integer getIdentType() {
        return identType;
    }

    public void setIdentType(Integer identType) {
        this.identType = identType;
    }

    @XmlTransient
    public List<Intervention> getInterventionList() {
        return interventionList;
    }

    public void setInterventionList(List<Intervention> interventionList) {
        this.interventionList = interventionList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (identType != null ? identType.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TypeIntervention)) {
            return false;
        }
        TypeIntervention other = (TypeIntervention) object;
        if ((this.identType == null && other.identType != null) || (this.identType != null && !this.identType.equals(other.identType))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return type;
    }
    
}
